import  Vue from 'vue';
import VueRouter from 'vue-router';

Vue.use(VueRouter); //使用路由

const routes = [
  { path:'/',redirect:'/home' },
  { path: '/home', component: () => import("views/home/home.vue") },
  { path: '/profile', component: () => import("views/profile/profile.vue") },
  { path: '/category', component: () => import("views/category/category.vue") },
  { path: '/cart', component: () => import("views/cart/cart.vue") },
  { path: '/detail', component: () => import("views/detall/detail.vue") },
  /* { path: '/detail/:iid', component: () => import("views/detall/detail.vue") } */, /* 动态路由 */

]

const router = new VueRouter({
  mode: 'history',
  routes
});
export default router //导出